package com.example.toolproject.demo.service.serviceimpl;

import com.example.toolproject.demo.domain.Title;
import com.example.toolproject.demo.domain.Video;
import com.example.toolproject.demo.mapper.HomePageMapper;
import com.example.toolproject.demo.service.HomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName HomePageServiceImpl
 * @Description TODO
 * @Author lvyongwei
 * @Date 2020-08-10 15:54
 **/
@Service
public class HomePageServiceImpl implements HomePageService {

    @Autowired
    private HomePageMapper homePageMapper;

    /**
     * 修改视频信息
     * @param video  视频实体
     * @return
     */
    @Override
    public boolean updateVideo(Video video) {
        return homePageMapper.updateVideo(video);
    }

    /**
     * 获取全部视频信息
     * @return
     */
    @Override
    public List<Video> getIndexVideo() {
        return homePageMapper.getIndexVideo();
    }

    /**
     * 根据标题id获取标题实体
     * @param titleId
     * @return
     */
    @Override
    public Title getTitle(Integer titleId) {
        return homePageMapper.getTitle(titleId);
    }

    /**
     * 更新标题内容
     * @param title
     * @return
     */
    @Override
    public boolean updateTitle(Title title) {
        return homePageMapper.updateTitle(title);
    }
}
